package com.ysd.lis.controller.bac;


import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.bac.BacCultureMedium;
import com.ysd.lis.request.BacCultureMediumDto;
import com.ysd.lis.service.bac.BacCultureMediumService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author bai
 * @since 2024-04-10
 */
@RestController
@RequestMapping("/api/bac/bac-culture-medium")
public class BacCultureMediumController extends BaseController {

    @Autowired
    BacCultureMediumService bacCultureMediumService;

    @ApiOperation("查询")
    @GetMapping("/findBacCultureMediumList")
    public Result findBacCultureMediumList(BacCultureMedium bacCultureMedium) {
        return Result.succ(bacCultureMediumService.findBacCultureMediumList(bacCultureMedium));
    }

    @ApiOperation("查询培养基")
    @GetMapping("/findBacCultureMediums")
    public Result findBacCultureMediums(BacCultureMedium bacCultureMedium) {
        return Result.succ(bacCultureMediumService.findBacCultureMediums(bacCultureMedium));
    }

    @ApiOperation("增加")
    @PostMapping("/addBacCultureMedium")
    public Result addBacCultureMedium(@RequestBody BacCultureMedium bacCultureMedium) {
        return bacCultureMediumService.addBacCultureMedium(bacCultureMedium);
    }

    @ApiOperation("删除")
    @PostMapping("/deleteBacCultureMedium")
    public Result deleteBacCultureMedium(@RequestBody BacCultureMediumDto bacCultureMediumDto) {
        return bacCultureMediumService.deleteBacCultureMedium(bacCultureMediumDto);
    }

    @ApiOperation("修改")
    @PostMapping("/updateBacCultureMedium")
    public Result updateBacCultureMedium(@RequestBody BacCultureMedium bacCultureMedium) {
        return bacCultureMediumService.updateBacCultureMedium(bacCultureMedium);
    }

    @ApiOperation("批量修改")
    @PostMapping("/updateBatchBacCultureMedium")
    public Result updateBatchBacCultureMedium(@RequestBody BacCultureMediumDto bacCultureMediumDto) {
        return bacCultureMediumService.updateBatchBacCultureMedium(bacCultureMediumDto);
    }

    @ApiOperation("根据培养基ID数组查询培养基")
    @GetMapping("/findBacCultureMediumListByIds")
    public Result findBacCultureMediumListByIds(@RequestParam("ids[]") List<String> ids) {
        return bacCultureMediumService.findBacCultureMediumListByIds(ids);
    }


}
